package com.zsh.rabbitmq.springbootrabbitmq.consumer;

import com.zsh.rabbitmq.springbootrabbitmq.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author zsh
 * @Description 备份交换机，报警消费者
 * @create 2022-05-08 10:41
 */
@Slf4j
@Component
public class WarningConsumer {

    @RabbitListener(queues = ConfirmConfig.WARNING_QUEUE_NAME)
    public void receiveWarningMessage(Message message) throws Exception {
        String msg = new String(message.getBody(),"UTF-8");
        log.error("不可路由的消息为：{}",msg);
    }
}
